<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<html>
<head>
  <title>首页</title>
</head>
<body>
<p c:if="${not empty username}">
  欢迎${realName}, ${username}
</p>
<br/>
以下是网站的功能：
<ul>
  <security:authorize access="hasAuthority('ROLE_PRODUCT_ADD')">
    <li><a href="${pageContext.request.contextPath}/product/add">商品添加</a></li>
  </security:authorize>
  <security:authorize access="hasAuthority('ROLE_PRODUCT_UPDATE')">
    <li><a href="${pageContext.request.contextPath}/product/update">商品修改</a></li>
  </security:authorize>
  <security:authorize access="hasAuthority('ROLE_PRODUCT_LIST')">
    <li><a href="${pageContext.request.contextPath}/product/list">商品查询</a></li>
  </security:authorize>
  <security:authorize access="hasAuthority('ROLE_PRODUCT_DELETE')">
    <li><a href="${pageContext.request.contextPath}/product/delete">商品删除</a></li>
  </security:authorize>

</ul>
<br/>
<a href="${pageContext.request.contextPath}/logout">退出</a>
</body>
</html>
